from authlib.jose import jwt
from meiduo_mall.settings import SECRET_KEY
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
def encrypt(message):
    s=Serializer(secret_key=SECRET_KEY,expires_in=3600)
    return s.dumps(message).decode()
def decrypt(message):
    s = Serializer(secret_key=SECRET_KEY, expires_in=3600)
    try:
        return s.loads(message)
    except Exception:
        pass